#!/bin/bash
#  Script de compilation du projet ILLUMINA
#  2005
#
#
#    Copyright (C) 2012  Martin Aube
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#    Contact: martin.aube@cegepsherbrooke.qc.ca
#
F77="gfortran"
folder=`pwd`
echo $F77" -O3 illumina.f reflexion-double_diff.f lignevisee.f zone_diffusion.f diffusion.f angle3points.f anglesolide.f transmita.f transmitm.f anglezenithal.f intrants2d.f planzx.f planyz.f planxy.f extrants2d.f interpmatrix.f angleazimutal.f horizon.f -o bin/illumina"
$F77 -O3 illumina.f reflexion-double_diff.f lignevisee.f zone_diffusion.f diffusion.f angle3points.f anglesolide.f transmita.f transmitm.f anglezenithal.f intrants2d.f planzx.f planyz.f planxy.f extrants2d.f interpmatrix.f angleazimutal.f horizon.f -o bin/illumina
echo $F77" ies2fctem.f -o bin/ies2fctem.exe"
$F77 ies2fctem.f -o bin/ies2fctem.exe
echo $F77" continue_illumina.f  -o bin/continue_illumina"
$F77 continue_illumina.f  -o bin/continue_illumina
echo $F77" ols2lum.f intrants2d.f extrants2d.f -o bin/ols2lum"
$F77 ols2lum.f intrants2d.f extrants2d.f -o bin/ols2lum
echo $F77" L569-546toVmag-OT.f -o bin/L569-546toVmag-OT"
$F77 L569-546toVmag-OT.f -o L569-546toVmag-OT
echo $F77" L569-615toVmag-ORM.f -o bin/L569-615toVmag-ORM"
$F77 L569-615toVmag-ORM.f -o L569-615toVmag-ORM
echo $F77" circular-pgm-integ.f intrants2d.f -o bin/circular-pgm-integ"
echo $F77" CompareToMiro.f -o bin/CompareToMiro"
$F77 CompareToMiro.f -o bin/CompareToMiro

$F77 circular-pgm-integ.f intrants2d.f -o bin/circular-pgm-integ
echo $F77" moypondpgm16bit.f intrants2d.f extrants2d.f -o bin/moypondpgm16bit"
$F77 moypondpgm16bit.f intrants2d.f extrants2d.f -o bin/moypondpgm16bit
echo $F77" interp-pgm16bit.f intrants2d.f extrants2d.f -o bin/interp-pgm16bit"
$F77 interp-pgm16bit.f intrants2d.f extrants2d.f -o bin/interp-pgm16bit
echo $F77" rad2lrad.f -o bin/rad2lrad"
$F77 rad2lrad.f -o bin/rad2lrad
cd rand_map
echo "gcc -lm rand_pre.c -o ../bin/rand_pre"
gcc rand_pre.c -o ../bin/rand_pre -lm  
echo "gcc -lm rand_post.c -o ../bin/rand_post"
gcc rand_post.c -o ../bin/rand_post -lm  
echo "gcc -lm comp_reduc.c -o ../bin/comp_reduc"
gcc comp_reduc.c -o ../bin/comp_reduc -lm
cd ..
echo $F77" readvalue.f intrants2d.f -o bin/readvalue"
$F77 readvalue.f intrants2d.f -o bin/readvalue
echo $F77" utils/mietool/MakeMieIn.f -o bin/MakeMieIn"
$F77 utils/mietool/MakeMieIn.f -o bin/MakeMieIn
echo $F77" utils/mietool/MakePSD.f -o bin/MakePSD"
$F77 utils/mietool/MakePSD.f -o bin/MakePSD
echo $F77" utils/mietool/cmbpsd.f -o bin/cmbpsd"
$F77 utils/mietool/cmbpsd.f -o bin/cmbpsd
echo $F77" utils/mietool/intermie.f -o bin/intermie"
$F77 utils/mietool/intermie.f -o bin/intermie
echo $F77" AllSkyRatio.f -o bin/AllSkyRatio"
$F77 AllSkyRatio.f -o bin/AllSkyRatio
echo $F77" rad2polar.f -o bin/rad2polar"
$F77 rad2polar.f -o bin/rad2polar
echo $F77" pgmcombine16bit.f intrants2d.f extrants2d.f -o bin/pgmcombine16bit"
$F77 pgmcombine16bit.f intrants2d.f extrants2d.f -o bin/pgmcombine16bit
echo $F77" ratiopmg16bit.f intrants2d.f extrants2d.f -o bin/ratiopgm16bit"
$F77 ratiopgm16bit.f intrants2d.f extrants2d.f -o bin/ratiopgm16bit
echo $F77" substractpmg16bit.f intrants2d.f extrants2d.f -o bin/substractpgm16bit"
$F77 substractpgm16bit.f intrants2d.f extrants2d.f -o bin/substractpgm16bit
echo $F77" circular-pgm-integ.f intrants2d.f extrants2d.f -o bin/circular-pgm-integ"
$F77 circular-pgm-integ.f intrants2d.f extrants2d.f -o bin/circular-pgm-integ
echo $F77" varres.f intrants2d.f extrants2d.f -o bin/varres"
$F77 varres.f intrants2d.f extrants2d.f -o bin/varres
echo $F77" retres.f intrants2d.f extrants2d.f -o bin/retres"
$F77 retres.f intrants2d.f extrants2d.f -o bin/retres
echo $F77" viirs2lum.f intrants2d.f extrants2d.f -o bin/viirs2lum"
$F77 viirs2lum.f intrants2d.f extrants2d.f -o bin/viirs2lum
echo $F77" writevalue16bit.f extrants2d.f -o bin/writevalue16bit"
$F77 writevalue16bit.f extrants2d.f -o bin/writevalue16bit
chmod a+x bin/*
chmod a+x *.bash
